package top.lyc829.mymusic.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import top.lyc829.mymusic.R
import top.lyc829.mymusic.databinding.ItemPlaylistBinding
import top.lyc829.mymusic.ext.getCorrespondString
import top.lyc829.mymusic.ext.load
import top.lyc829.mymusic.model.bean.PlayListSimple

/**
 * @Author lyc
 * @create 2021-07-15 19:26
 */
class IndexRecommendPlayListAdapter : BaseQuickAdapter<PlayListSimple, BaseViewHolder>(
    R.layout.item_playlist
) {
    override fun convert(holder: BaseViewHolder, item: PlayListSimple) {
        val binding : ItemPlaylistBinding = ItemPlaylistBinding.bind(holder.itemView)
        binding.ivItemDiscover.load(item.picUrl, 10)
        binding.tvItemDiscoverPlaynum.text = item.playCount.getCorrespondString
        binding.tvItemDiscoverDes.text = item.name
    }
}